from random import random, randint

# for i in range(1,10+1,2):
#     print(i,end="\t")
#
# #打印100以内能被3整除的数字
# for i in range(1,100+1):
#     if i%3==0:
#         print(i,end="\t")
#
# num =randint(1,20)
# while True:
#     guess = int(input("请输入一个数字："))
#     if guess > num:
#         print("太大了")
#     elif guess < num:
#         print("太小了")
#     else:
#         print("猜对了")
#         break
#
#      #逢7过
# for i in range(1,100+1):
#     # if i % 7 == 0 or str(i).find('7') != -1:
#     # if i % 7 == 0 or str(i).count('7') > 0:
#     if i % 7 == 0 or '7' in str(i) != -1:
#         print(i, end="\t")


# # 打印菱形
for i in range(1,11+1,2):
    print(("*"*i).center(11))
for i in range(9,0,-2):
        print(("*"*i).center(11))


# for i in range(1,11+1,2):
#     print(("*"* i).center(11))#center字符串居中
# for i in range(9,0,-2):
#   print(("*"* i).center(11))
# #打印菱形2多层嵌套
# row = eval(input('请输入菱形的行数：'))
# while row % 2 == 0:  # 判断行数的奇偶性
#     print('请重新输入菱形的行数：')
#     row = eval(input('请输入菱形的行数：'))
# # 输出菱形
# top_row = (row + 1) // 2  # 上半部分的行数
# # 上半部分
# for i in range(1, top_row + 1):  # 外层循环5行
#     # 倒三角形
#     for j in range(1, top_row + 1 - i):
#         print(' ', end='')
#     # 1，3，5，7，，，等腰三角形，range(1,2),range(1,4),range(1,6).....
#     for k in range(1, i * 2):
#         print('*', end='')
#     print()  # 当两个并列的for循环执行完成后，再换行
#
# # 下半部分
# bottom_row = row // 2
# for i in range(1, bottom_row + 1):
#     # 直角三角形
#     for j in range(1, i + 1):
#         print(' ', end='')
#     # 倒三角
#     for k in range(1, bottom_row * 2 - 2 * i + 2):  # 1-->range(1,6),2-->range(1,4),3-->range(1,2),
#         print('*', end='')
#     print()

# 打印水仙花数
# for i in range(1, 100 + 1):

# for num in range(100, 1000):
#     digit1 = num // 100
#     digit2 = (num // 10) % 10
#     digit3 = num % 10
#     if digit1**3+digit2**3+digit3**3 == num:
#         print(num)
#



    # 打印100 以内的质数
# def is_prime(num):
#    if num <= 1:
#        return False
#    for i in range(2, int(num ** 0.5) + 1):
#        if num % i == 0:
#            return False
#     return True

# for num in range(2,101):
#     is_prime = True
#     for i in range(2,int(num**0.5)+1):
#         if num % i ==0:
#             is_prime=False
#             break
#     if is_prime:
#         print(num)
#



#     # 打印斐波那契数列
# for i in range(1, 10 + 1):
#     for j in range(1, i + 1):
#         print(j, end="\t")
#     print()

# n=int(input("请输入要打印的斐波那契数列项数："))
# f=[]
# if n==0:
#     pass
# elif n==1:
#     f.append(0)
# elif n==2:
#     f.append(0)
#     f.append(1)
# else:
#     f.append(0)
#     f.append(1)
#     for i in range(2,n):
#         f.append(f[i-1]+f[i-2])
#     print(f)
# n=int(input("请输入要打印的斐波那契数列项数："))
# a,b=0,1
# print(a)
# print(b)
# for i in range(2,n):
#     c=a+b
#     print(c)
#     a,b=b,c



#     # 打印九九乘法表
# for i in range(1, 10 + 1):
#     for j in range(1, i + 1):
#         # print(j + "*" + "i" + "=" + j * i, end="\t")
#         print("%d*%d=%d" % (j, i, j * i), end="\t")
#     print()

# # 打印100以内的完数
# for num in range(1, 101):
#     sum = 0
#     for factor in range(1, num):
#         if num % factor == 0:
#             sum+=factor
#     if sum == num:
#         print(num)

# for num in range(1,101):
#     sum=0
#     for i in range(1,num):
#         if num%i==0:
#             sum+=i
#     if sum==num:
#         print(num)
